//
//  GCMOUTLINETableViewCell.m
//  GeeCityManager
//
//  Created by 聚城科技 on 17/1/6.
//  Copyright © 2017年 聚城科技. All rights reserved.
//

#import "GCMOUTLINETableViewCell.h"

@implementation GCMOUTLINETableViewCell{
    
    UIView * _bgView;
    UIImageView *_rightImageV;
    UILabel *_titleLabel;
    UILabel *_detailLabel;
    UILabel *_JDRLabel;
    UILabel *_SLRLabel;
    UILabel *_ZTLabel;
    UILabel *_dataLabel;
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createUI];
    }
    return self;
}

-(void)createUI{
    
    _bgView = [[UIImageView alloc]init];
    _bgView.frame =CGRectMake(10, 10,SCREEN_WIDTH - 20, 160);
    _bgView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:_bgView];
    
    _titleLabel = [[UILabel alloc]init];
    _titleLabel.frame = CGRectMake(20,10,_bgView.bounds.size.width, 25);
    _titleLabel.font = [UIFont systemFontOfSize:15];
    _titleLabel.textColor = [UIColor lightGrayColor];
    _titleLabel.textAlignment = NSTextAlignmentLeft;
    [_bgView addSubview:_titleLabel];
    
    _detailLabel = [[UILabel alloc]init];
    _detailLabel.frame = CGRectMake(20 ,35 , _bgView.bounds.size.width - 40, 25);
    _detailLabel.font = [UIFont systemFontOfSize:14];
    _detailLabel.textColor = [UIColor colorWithRed:0.58 green:0.65 blue:0.65 alpha:1.00];
    _detailLabel.textAlignment = NSTextAlignmentLeft;
    [_bgView addSubview:_detailLabel];
    
    _JDRLabel = [[UILabel alloc]init];
    _JDRLabel.frame = CGRectMake(20,60, _bgView.bounds.size.width - 40,25 );
    _JDRLabel.font = [UIFont systemFontOfSize:14];
    _JDRLabel.textAlignment = NSTextAlignmentLeft;
    _JDRLabel.textColor = [UIColor colorWithRed:0.58 green:0.65 blue:0.65 alpha:1.00];
    [_bgView addSubview:_JDRLabel];
    
    _SLRLabel = [[UILabel alloc]init];
    _SLRLabel.frame = CGRectMake(20,85, _bgView.bounds.size.width -40,25 );
    _SLRLabel.font = [UIFont systemFontOfSize:14];
    _SLRLabel.textAlignment = NSTextAlignmentLeft;
    _SLRLabel.textColor = [UIColor colorWithRed:0.58 green:0.65 blue:0.65 alpha:1.00];
    [_bgView addSubview:_SLRLabel];
    
    _ZTLabel = [[UILabel alloc]init];
    _ZTLabel.frame = CGRectMake(20,110, _bgView.bounds.size.width - 40,25 );
    _ZTLabel.font = [UIFont systemFontOfSize:14];
    _ZTLabel.textAlignment = NSTextAlignmentLeft;
    _ZTLabel.textColor = [UIColor colorWithRed:0.58 green:0.65 blue:0.65 alpha:1.00];
    [_bgView addSubview:_ZTLabel];
    
    _dataLabel = [[UILabel alloc]init];
    _dataLabel.frame = CGRectMake(20,135, _bgView.bounds.size.width - 5,25 );
    _dataLabel.font = [UIFont systemFontOfSize:14];
    _dataLabel.textAlignment = NSTextAlignmentLeft;
    _dataLabel.textColor = [UIColor colorWithRed:0.58 green:0.65 blue:0.65 alpha:1.00];
    [_bgView addSubview:_dataLabel];
    
}
-(void)setSheBeiModel:(GCMOUTLINESheBei *)SheBeiModel{
    
    _SheBeiModel = SheBeiModel;
    _titleLabel.text = [NSString stringWithFormat:@"设备名称:%@",SheBeiModel.sbname];
    _detailLabel.text = [NSString stringWithFormat:@"设备状态:%@",SheBeiModel.type];
    _JDRLabel.text = [NSString stringWithFormat:@"所在位置:%@",SheBeiModel.sbid];
    _SLRLabel.text = [NSString stringWithFormat:@"巡检计划:%@",SheBeiModel.zq];
    _ZTLabel.text = [NSString stringWithFormat:@"上次巡检备注:经检验正常"];
    _dataLabel.text = [NSString stringWithFormat:@"上次巡检时间:%@",SheBeiModel.xjrq];
    
    //type = 巡检,
    //sbid = 29,
    //zq = 日,
    //xjrq = 2016-12-01 16:54:57,
    //days = 7,
    //sbname = 强电箱
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
